/***************************************************************************
 * CR_Slink -- Copyright Bit Armory Labs 2007
 *
 * FILE:     SlinkPlugInSettings.cs, 55 code lines, [1.56 KB]
 * DATE:     8/31/2007 4:26 PM
 * MODIFIED: 9/3/2007 12:23 PM
 * PATH:     C:\Programming\Projects\Slink\SourceCode\CR_Slink
 *
 * NAMESPACE: CR_Slink
 * CLASS:     SlinkPlugInSettings
 *
 * AUTHOR:   Brian Chavez (Cowboy), bchavez@bitarmory.com
 *
 *                        Licence
 *
 * This library, code generator, and source code
 * is licensed under the terms and conditions defined in the GNU Public
 * License. You are free to use it for non-commercial purposes.
 * If you are going to use any part of it in a commercial 
 * application, contact me and we can work something out.
 * You may use the code generated output of Slink and Slink
 * as a development tool in both commercial and 
 * non-commercial applications.
 *
 * THE SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS", WITHOUT WARRANTY
 * OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE AUTHOR BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF THIS
 * SOFTWARE.
 *
 * Copyright 2007 - Brian Chavez - Bit Armory
 * Email:    bchavez@bitarmory.com
 * Website:  http://www.bitarmory.com
 * Blog:     http://bchavez.bitarmory.com
 *
 ***************************************************************************/

using DevExpress.CodeRush.Core;

namespace CR_Slink
{
    /// <summary>
    /// Slink options
    /// </summary>
    public static class SlinkPlugInSettings
    {
        /// <summary>
        /// Sections
        /// </summary>
        private static class BuildOptions
        {
            internal const string Section = "BuildOptions";
            /// <summary>
            /// Keys
            /// </summary>
            internal static class Keys
            {
                internal const string UseFileSystemWatchers = "UseFileSystemWatchers";
            }
        }

        /// <summary>
        /// Storage
        /// </summary>
        /// <returns>Decoupled storage</returns>
        private static DecoupledStorage Storage
        {
            get
            {
                return CodeRush.Options.GetStorage( SlinkPlugInWindow.GetCategory(), SlinkPlugInWindow.GetPageName() );
            }
        }

        /// <summary>
        /// Use file system watchers
        /// </summary>
        /// <returns>Bool</returns>
        public static bool UseFileSystemWatchers
        {
            get
            {
                return SlinkPlugInSettings.Storage.ReadBoolean( SlinkPlugInSettings.BuildOptions.Section, SlinkPlugInSettings.BuildOptions.Keys.UseFileSystemWatchers );
            }
            set
            {
                SlinkPlugInSettings.Storage.WriteBoolean( SlinkPlugInSettings.BuildOptions.Section, SlinkPlugInSettings.BuildOptions.Keys.UseFileSystemWatchers, value );
            }
        }

    }
}
